/*
 * Filename DeviceCheckStatus.java 2021年11月03日
 * Copyright © Ehome Co.Ltd. All Rgiths Reserved.
 * @author wuyingchao
 */
package com.ehome.poct.core.api.constant.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 联机设备检测状态
 *
 * @author wyc
 * @since 2021/11/03 10:01
 **/
@Getter
public enum DeviceCheckStatus {
    WAIT(0, "待检测"),
    IN_PROGRESS(5, "进行中"),
    FINISH(10, "已完成");
    private final int type;
    private final String desc;

    DeviceCheckStatus(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static DeviceCheckStatus getByType(int type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }
}